﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BattleTetrixReloaded
{
    public class tet_score
    {
        private long Score = 0;        //game score
        private long scoreMultiplier = 1; //current mu;tip[lier
        private long StarsScored = 0; 

        const int MAXMULTIPLIER = 16; //the maximum ammount of multiplier you can reach.


        public long getStarsScored()
        {
            return StarsScored;
        }

        public long getScore()
        {
            return Score;
        }

        public long getScoreMultiplier()
        {
            return scoreMultiplier;
        }

        public void addInstaDropBonus(int currentRow)
        {
            Score = Score + 2 * currentRow;
        }

        public void addSoftDropBonus()
        {
            Score += 1;
        }

        public void addStarBonus()
        {
            Score = Score + 50;
            scoreMultiplier = scoreMultiplier + 1;
        }

        public void addNonScoringMove()
        {
            scoreMultiplier = 1;                      
        }

        public void addScoringMove(int clearedLines)
        {
            if (clearedLines == 1) Score += (100 * tet_game_loop.level) * scoreMultiplier;
            if (clearedLines == 1) Score += (300 * tet_game_loop.level) * scoreMultiplier;
            if (clearedLines == 1) Score += (500 * tet_game_loop.level) * scoreMultiplier;
            if (clearedLines == 1) Score += (800 * tet_game_loop.level) * scoreMultiplier;           
            
            scoreMultiplier += clearedLines;

            if (scoreMultiplier > MAXMULTIPLIER) scoreMultiplier = MAXMULTIPLIER;
        }
 
        public void resetScore()
        {
            Score = 0;
            scoreMultiplier = 1;
        }
    }
}
